"use strict"

import * as path from "path";
import * as fs from "fs";

let file: string = "E:\\TypeScript\\jcre\\cn\\com\\bitshield\\pboc\\util\\javacard\\util.jca";


let jcadata: Buffer = fs.readFileSync(file);
let strjca: string = jcadata.toString();
let regstr = /\.package ([a-zA-Z0-9/]+) \{\s*.aid ([0-9A-Fx:]+);/;
let result = regstr.exec(jcadata.toString());
console.log("0: "+result[0]); // 输出全部的匹配结果
console.log("1: "+result[1]); // 输出 $1
console.log("2: "+result[2]); // 输出 $2
// result[2] = 0xF0:0x62:0x73
// 要替换所有的，表达式后缀加g，否则只替换第1个
let pkgaid = result[2].replace(/:/g,""); 

